package com.start.workflow.act;

import com.alibaba.fastjson2.JSONObject;
import com.start.common.entity.StartBaseUser;
import com.start.workflow.common.enums.StartActHandlerStatus;
import com.start.workflow.entity.StartActBusinessEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class StartProcInstInst extends StartProcDef<StartProcTaskInst> {
    @Schema(name = "流程实例id")
    private String procInstId;

    @Schema(name = "申请人")
    private StartBaseUser startUser;

    @Schema(name = "表单数据")
    private JSONObject procFormData;
    @Schema(name = "流程申请状态")
    private StartActHandlerStatus procState;

    @Schema(name = "申请时间")
    private LocalDateTime startTime;
    @Schema(name = "申请结束时间")
    private LocalDateTime endTime;

    public StartProcInstInst(StartActBusinessEntity startActBusiness) {
        procInstId = startActBusiness.getProcInstId();
        setProcName(startActBusiness.getProcDefName());
        setProcDefKey(startActBusiness.getProcDefKey());
        setProcCategoryKey(startActBusiness.getProcDefCategory());
        startTime = startActBusiness.getProcStartTime();
        endTime = startActBusiness.getProcEndTime();
    }

}
